test(e2e): align feature-extraction e2e tests with #807 modality-aware logic#820
Merged
Conversation
…ty-aware logic #807 made detect_task modality-aware and removed #786's bimodal io_config reverse-reconstruction, but #786's e2e tests still asserted the old bimodal behavior and now fail on main. Under the new task vocabulary feature-extraction is text-only and a vision model's canonical task is image-feature-extraction (what inspect/auto-detect report); explicit --task feature-extraction on a vision model is now a mismatch that errors. - quantize: test_feature_extraction_with_pixel_values_uses_image_dataset -> test_image_feature_extraction_uses_image_dataset (--task image-feature-extraction) - eval: drop the feature-extraction param from test_image_feature_extraction; loosen knn floors to sanity levels (10/25) per the file's N=10 convention
zhenchaoni
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
#807(merged) madedetect_taskmodality-aware and removed#786's bimodalfeature-extractionio_config reverse-reconstruction (in bothdatasetsandeval). But#786's e2e tests — still onmain— assert the old bimodal behavior, so they now fail onmain:tests/e2e/test_quantize_e2e.py::TestPerTaskDatasets::test_feature_extraction_with_pixel_values_uses_image_datasettests/e2e/test_eval_e2e.py::TestEvalPerTask::test_image_feature_extraction[feature-extraction]Both crash with
KeyError: Dinov2Config— a vision model +--task feature-extractionnow resolves to the textTextDataset, which tries to load a tokenizer DINOv2 does not have.Why update the tests (not revert the code)
Under the merged modality-aware task vocabulary:
feature-extractionis the text feature task; a vision embedding model's canonical task isimage-feature-extraction.winml inspect/ auto-detect always reportimage-feature-extractionfor a vision model (e.g.facebook/dinov2-small) — the tool never hands a user--task feature-extractionfor a vision model.--task feature-extractionon a vision model is a genuine modality mismatch and is expected to error. The#786bimodal io_config dispatch (which silently recovered modality from the ONNX inputs) was deliberately removed in#807.The e2e tests follow the new logic:
test_feature_extraction_with_pixel_values_uses_image_dataset→test_image_feature_extraction_uses_image_dataset, asserting--task image-feature-extraction→ImageDataset(the canonical vision-feature calibration path).feature-extractionparam fromtest_image_feature_extraction(vision feature =image-feature-extraction). Also loosen the kNN floors to sanity levels (10/25), consistent with this file's N=10 convention ("Loose floors guard against degenerate output, not magnitude") — the previous 30/60 floors flaked at top1=20 on a 10-sample kNN.Heads-up for @zhenchaoni
This realigns the two e2e tests you added in
#786and, by extension, accepts dropping the bimodal--task feature-extraction-on-a-vision-model capability#786introduced. That removal landed in#807(merged); this PR only updates the tests to match. If you'd rather keep that capability working (graceful) instead of erroring on the mismatch, that means restoring the io_config dispatch — happy to do that instead. Flagging for your call.